//
//  MoreNewsViewCell.m
//  斗鸡TV
//
//  Created by admin on 16/8/5.
//  Copyright © 2016年 admin. All rights reserved.
//

#import "MoreNewsViewCell.h"
#define WIDTH [UIScreen mainScreen].bounds.size.width
#define HEIGHT [UIScreen mainScreen].bounds.size.height
@implementation MoreNewsViewCell
{
    UIImageView * imgV;
    UILabel * titleLable;
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        
        
        [self initView];
    }
    
    return self;
}

-(void)initView
{
    imgV = [[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 100, 60)];
    imgV.clipsToBounds = YES;
    imgV.layer.cornerRadius = 10;
    [self.contentView addSubview:imgV];
    
    CGFloat titleX = CGRectGetMaxX(imgV.frame)+10;
    titleLable = [[UILabel alloc]initWithFrame:CGRectMake(titleX, 10, WIDTH - titleX-10, 60)];
    [self.contentView addSubview:titleLable];
    titleLable.numberOfLines = 0;
//    titleLable.backgroundColor = [UIColor yellowColor];
    
}


-(void)initCellData:(NSDictionary *)dic
{
     [imgV setImageWithURL:[NSURL URLWithString:[dic stringForKey:@"picUrl"]] placeholderImage:[UIImage imageNamed:@""]];
    titleLable.text = [dic stringForKey:@"title"];
}
-(void)setCellData:(SubWaQuModel *)subM
{
    [imgV setImageWithURL:[NSURL URLWithString:subM.imgUrl] placeholderImage:[UIImage imageNamed:@""]];
    titleLable.text = subM.title;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
